package com.example.houseweb.controller;

import com.example.housebiz.service.RecommendService;
import com.example.housecommon.model.House;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2018-05-29
 **/
@Controller
public class HomepageController {

    @Autowired
    private RecommendService recommendService;



    @RequestMapping("/index")
    public String accountsRegister(ModelMap modelMap) {
    List<House> houses = recommendService.getLastest();
    modelMap.put("recomHouses",houses);
        return "/homepage/index";
    }

    @RequestMapping("")
    public String index() {
        return "redirect:/index";
    }

}




